<?
$news = $this->news;
$page = $this->page;

//if (!$this->nodate) {

//var_dump($page);
//die;
?>

<div class="aside" style="border-radius: 5px;background: #f3f5f7; padding-left: 25px; padding-bottom: 13px;">
    <?if (!$page) {
    ?>  <h3>News</h3>

    <div style="top: 20px; right: 0px;">
        <h4>

            <a id="viewnews" href="allnews">View last 25 news...</a>
        </h4>
    </div>
    <? } else { ?>
    <h3><?= $page ?></h3>
    <? } ?>

    <!-- START BOX -->
    <div >
        <?

        foreach ($news as $one_news) {
            ?>
            <div>

                <?if (!$page) { ?>
                <p><img width="80px" src="<?=$one_news["img"]?>" alt="img">
                    <?= $one_news["title"] ?>
                    <span>

                <strong>


                    <?
                    if (!$page) {
                        $TIME = $one_news["date"];
                        echo $TIME->format('Y-m-d ');
                    }
                    ?>
                </strong>

            </span>

                </p>
                <? }?>

                <? if ($page): ?>
                <a href="<?= $this->url(array('id' => $one_news['id']), 'pages'); ?>"
                   class="similar" style="position: relative;float: left; font-size: 20px; font-weight: bold; right: 0px;"  >
                    <li>
                        <?= $one_news['title'] ?>
                    </li>
                </a>
                <? else: ?>
                <a href="news/<?= $one_news["id"]?>" class="button"></a>
                <!--            <a href="#news" class="button"></a>-->
                <? endif; ?>

            </div>
            <?
        }?>
    </div>


    <!-- END BOX -->
</div>


